home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Documents / JAVA Programming / examples / 16 / BorderLayoutDemo.class (.txt) next >
Encoding:
Java Class File  |  2000-09-08  |  1.2 KB  |  21 lines

  1. import java.applet.Applet;
  2. import java.awt.BorderLayout;
  3. import java.awt.Button;
  4. import java.awt.Container;
  5. import java.awt.Label;
  6. import java.awt.TextArea;
  7.  
  8. public class BorderLayoutDemo extends Applet {
  9.    public void init() {
  10.       ((Container)this).setLayout(new BorderLayout());
  11.       Integer.parseInt(((Applet)this).getParameter("width"));
  12.       Integer.parseInt(((Applet)this).getParameter("height"));
  13.       ((Container)this).add("North", new Button("This is across the top"));
  14.       ((Container)this).add("South", new Label("The footer message might go here"));
  15.       ((Container)this).add("East", new Button("Left"));
  16.       ((Container)this).add("West", new Button("Right"));
  17.       String var1 = "The reasonable man adapts himself to the world;\nthe unreasonable one persists in trying to adapt the world to himself.\nTherefore all progress depends on the unreasonable rnan.\n\nGeorge Bernard Shaw\n\n";
  18.       ((Container)this).add("Center", new TextArea(var1));
  19.    }
  20. }
  21.